<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>供应商信息管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/basic/company";
		var basic_WUrl="yd/basic/company";
		var basic_Title="添加";
		var show_Width=380;
		var show_Hight=400;
		function createSearch(){
			init(1,8,'100,100,100,100,100,100,100,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","名称：");
			addCommon(0,1,"txtlike","name");	
			addCommon(0,2,"lable","联系人：");
			addCommon(0,3,"txtlike","attachperson");
			addCommon(0,4,"lable","描述：");
			addCommon(0,5,"txtlike","simplejakecn");
			addCommon(0,6,"lable","助记码：");
			addCommon(0,7,"txtlike","bizMnemonic");
		}
		
		function searchAP(type){
			multipleSearch("#table1",true,"",basic_Url+"/list.do?parentname=2");
		}
		//添加
		function addbill(){
			var url = basic_WUrl+"/operate/add/0.do?parent=2";
			
			ShowIframeDialog("operate",basic_Title,url,show_Width,show_Hight);
		}
		//编辑
		function editbill(data){
			var url = basic_WUrl+"/operate/edit/"+data.id+".do?parent=2";
			ShowIframeDialog("operate",basic_Title,url,show_Width,show_Hight);
		}
		$(function(){
			var grid = $("#table1").ligerGrid({
		        columns: [
 						  { display: '名称', name: 'name', width: 180 },
 						  { display: '编码', name: 'code', width: 160 },
		                  { display: '类别', name: 'parentname', width: 150 },
		                  { display: '地址', name: 'address', width: 180},
		                  { display: '联系人', name: 'attachperson', width: 100 },
		                  { display: '电话', name: 'telephone', width: 100},
		                  { display: '邮箱', name: 'email', width: 100},
		                  { display: '描叙', name: 'simplejakecn', width: 120}
		                      ],  usePager: true,pageSize:15,
		                      url : basic_Url+"/list.do?parentname=2",enabledSort:false,
		                      width: "100%", height:"100%",pageSizeOptions :[15,25,35], checkbox: true,      
		                      onDblClickRow : function (data, rowindex, rowobj){
		                    	  editbill(data);
		                       }
		                  });
			$("#pageloading").hide();
		});
		
		
		
	</script>
	
  </head>
 <body style="padding:10px" onLoad="createSearch()">  
       <div id="layout1">
          <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="addbill()">
		           <span>添加</span></a></li>
				   <li><a class="delete" onclick="del()"><span>删除</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
          <input type="hidden" id="type" name="type" value="${type}"/>
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
    </body>
</html>